import {FC} from 'react'

// 引入自定义hook
import useCounter from './useCounter'

let UseHook:FC<any> = () => {
    let [count,setCount] = useCounter(100)
    return(
        <fieldset>
            <legend>使用自定义hook</legend>
            <button onClick={()=>{
                setCount.decrease(10)
            }}>-</button>
            -
            <b>{count}</b>
            -
            <button onClick={()=>{
                setCount.increase(5)
            }}>+</button>
        </fieldset>
    )
}
export default UseHook